package com.example.mapper;

import com.example.domain.ZoneMeteorology;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ZoneMeteorologyMapper {

    @Select("select * from wmy.zone_meteorology")
    List<ZoneMeteorology> getAll();

    @Select("select * from wmy.zone_meteorology where zone_id = #{zoneId}")
    ZoneMeteorology getById(Integer zoneId);

    @Insert("insert into wmy.zone_meteorology (zone_id, meteorology_id) values (#{zoneId}, #{meteorologyId})")
    boolean add(ZoneMeteorology zoneMeteorology);

    @Update("update wmy.zone_meteorology set zone_id=#{zoneId},meteorology_id=#{meteorologyId} where zone_id = #{zoneId}")
    boolean update(ZoneMeteorology zoneMeteorology);

    @Delete("delete from wmy.zone_meteorology where zone_id = #{zoneId}")
    boolean delete(Integer zoneId);

}
